<?php

class Useradmin{

	public $username;
	public $password;
	public $name;
	
	public function getUser($username, $password){
		$query = "SELECT Username, Name FROM useradmin WHERE Username='{$username}' AND Password='{$password}'";
		$result = getQueryObject($query);
		if($result != null){
			$this->username 	= $result['Username'];
			$this->name 		= $result['Name'];
		}
	}
	
	public function addUser(){
		$query = "INSERT INTO useradmin(Username, Password, Name) values ('{$this->username}', '{$this->password}', '{$this->name}')";
		getQueryUpdate($query);
	}
	
	public function deleteUser(){
		$query = "DELETE useradmin WHERE Username='{$this->username}'";
		getQueryUpdate($query);
	}
}
?>